#ifndef DisplayMode_h
#define DisplayMode_h

#include <Defines.h>
#include <CSharpPropertyMethods.h>

// Riccsson includes.
#include <System/Object.h>

// XNA includes.
#include "SurfaceFormat.h"
#include "../Rectangle.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Graphics
			{
				class DisplayMode
				{
					#pragma region Fields

					private: SurfaceFormat format;
					private: int height;
					private: int refreshRate;
					private: int width;
							 
					PROP3(DisplayMode, float, AspectRatio)
					PROP3(DisplayMode, SurfaceFormat, Format)
					PROP3(DisplayMode, int, Height)
					PROP3(DisplayMode, int, RefreshRate)
					PROP3(DisplayMode, int, Width)
					PROP3(DisplayMode, Riccsson::Xna::Framework::Rectangle, TitleSafeArea)

					#pragma endregion Fields
					
					COPY_CONSTRUCTOR(DisplayMode)
					{
						PROP3_INIT_COPY(DisplayMode, float, AspectRatio);
						PROP3_INIT_COPY(DisplayMode, SurfaceFormat, Format);
						PROP3_INIT_COPY(DisplayMode, int, Height);
						PROP3_INIT_COPY(DisplayMode, int, RefreshRate);
						PROP3_INIT_COPY(DisplayMode, int, Width);
						PROP3_INIT_COPY(DisplayMode, Riccsson::Xna::Framework::Rectangle, TitleSafeArea);
					}

					#pragma region Properties
        
					public: PROP3_GET(float, AspectRatio)
					{
						return (float)(width / height);
					}
					private: PROP3_SET(float, AspectRatio){throw;}

					public: PROP3_GET(SurfaceFormat, Format)
					{
						return format;
					}
					private: PROP3_SET(SurfaceFormat, Format){throw;}

					public: PROP3_GET(int, Height)
					{
						return this->height;
					}
					private: PROP3_SET(int, Height){throw;}

					public: PROP3_GET(int, RefreshRate)
					{
						return this->refreshRate;
					}
					private: PROP3_SET(int, RefreshRate){throw;}

					public: PROP3_GET(int, Width)
					{
						return this->width;
					}
					private: PROP3_SET(int, Width){throw;}
        
					public: PROP3_GET(Riccsson::Xna::Framework::Rectangle, TitleSafeArea)
					{
						return Riccsson::Xna::Framework::Rectangle(0, 0, Width, Height);  
					}
					private: PROP3_SET(Riccsson::Xna::Framework::Rectangle, TitleSafeArea){throw;}

					#pragma endregion Properties

					#pragma region Constructors
        
					public: /*internal*/ DisplayMode(int width, int height, int refreshRate, SurfaceFormat format)
						: PROP3_INIT(DisplayMode, AspectRatio)
						, PROP3_INIT(DisplayMode, Format)
						, PROP3_INIT(DisplayMode, Height)
						, PROP3_INIT(DisplayMode, RefreshRate)
						, PROP3_INIT(DisplayMode, Width)
						, PROP3_INIT(DisplayMode, TitleSafeArea)
					{
						this->width = width;
						this->height = height;
						this->refreshRate = refreshRate;
						this->format = format;
					}

					#pragma endregion Constructors


					#pragma region Public Methods

					public: override bool Equals(const Riccsson::System::object* obj) const
					{
						return instanceof_const(obj, DisplayMode) && this == (DisplayMode*)obj;
					}

					public: override int GetHashCode()
					{
						//return (this->width.GetHashCode() ^ this->height.GetHashCode() ^ this->refreshRate.GetHashCode() ^ this->format.GetHashCode());
						throw;
					}

					public: override GC_PTR<Riccsson::System::string> ToString()
					{
						//return string.Format(CultureInfo.CurrentCulture, "{{Width:{0} Height:{1} Format:{2} RefreshRate{3}}}", new object[] { this->width, this->height, this->Format, this->refreshRate });
						throw;
					}

					#pragma endregion Public Methods
				};
				
				#pragma region Operators

				bool operator !=(DisplayMode& left, DisplayMode& right);

				bool operator ==(DisplayMode& left, DisplayMode& right);

				#pragma endregion Operators
			}
		}
	}
}

#endif
